/**
 * Created by cj on 2017/5/2.
 */

var myBadSingleton = (function () {
    //存储单例实例的引用
    var instance;
    function init() {
        //单例
        var privateRandomNumber = Math.random();
        return {
            getRandomNumber:function () {
                return privateRandomNumber;
            }
        };
    };
    return {
        //总是创建一个新的实例
        getInstance:function () {
            instance = init();
            return instance;
        }
    };
})();